package org.example.entitys.relationship;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @Description
 * @Author 魏锴
 * @Date 2023/11/10
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class Unit {
    private int id;//单元id
    private String unit_title;//单元名
    private String doc_path;//文本路径
    private String video_path;//视频路径
    private String unit_introduce;//单元简介
    private int father_id = -1;//父单元id
    private int is_chpt;//本单元内容是否为章单位:1表示为章单元，0表示小节单元
    private int course_id;//课程id
    private int learning_score;//完成本学习单元所得积分

    public Unit(String title, String doc_path, String video_path, String unit_introduce, String father_id, int course_id, int score) {
        this(-1, title, doc_path, video_path, unit_introduce, -1, 0, course_id, score);
        try {
            this.father_id = Integer.parseInt(father_id);
            this.is_chpt = 1;
        } catch (Exception ignored) {
        }
    }
}
